import time
def m(m1,N):
    for i in range(N-1):
        for j in range(N-1-i):
            if m1[j]<m1[j+1]:
                m1[j], m1[j+1] = m1[j+1],m1[j]
def readl(massive1):
    file = open(massive1,'r')
    data=file.readlines()
    return data
m1=readl("m1_sorted.txt")
razmer=len(m1)
t1=time.time()
m(m1,razmer)
t2=time.time()
print("m1_sorted",round((t2-t1)*1000),"milliseconds")
m1=readl("m2_reverse.txt")
razmer=len(m1)
t3=time.time()
m(m1,razmer)
t4=time.time()
print("m2_reverse",round((t4-t3)*1000),"milliseconds")
m1=readl("m3_shuffle.txt")
razmer=len(m1)
t5=time.time()
m(m1,razmer)
t6=time.time()
print("m3_shuffle",round((t6-t5)*1000),"milliseconds")
